import {Component} from 'react';
import Comment from './comment';

export default class CommentList extends Component{
    render(){
        return (
            <div className="commentList">
            {
                this.props.data.map(
                    comment=>{
                        return (
                            <Comment author={comment.author} key={comment.id}>{comment.text}</Comment>
                        );
                    }
                )
            }
            
          </div>
        );
    }
}